Skip to content

fix(renderer): keep kitty image placeholders (U+10EEEE) out of OSC 66 text-sizing - #1301

Open
arthurkatcher wants to merge 1 commit into
anomalyco:mainfrom
arthurkatcher:fix/kitty-placeholder-explicit-width
Open

fix(renderer): keep kitty image placeholders (U+10EEEE) out of OSC 66 text-sizing#1301
arthurkatcher wants to merge 1 commit into
anomalyco:mainfrom
arthurkatcher:fix/kitty-placeholder-explicit-width

Conversation

@arthurkatcher

Copy link
Copy Markdown

Summary

Fixes #1300.

When explicit_width is enabled, both diff-emit paths wrapped every pooled grapheme in OSC 66 text-sizing, including U+10EEEE, the kitty graphics protocol's Unicode placeholder. kitty only recognizes plain U+10EEEE cells as image placements, so wrapped placeholders render as blank cells exactly where a transmitted image should appear. kitty >= 0.40 answers the text-sizing probe, so explicit_width is on by default in real kitty sessions and the placeholder flow is broken out of the box.

This change skips explicitWidthOutput for graphemes that start with U+10EEEE (bare or carrying row/column diacritics) in both call sites in renderer.zig. All other graphemes keep explicit-width output.

Verification

  • Regression test first, per AGENTS.md: renders an emoji plus a placeholder row with explicit_width = true through TestRenderer and asserts the emoji is still OSC 66 wrapped while the placeholder cells go out bare. Red on main (fails on the wrapped-placeholder assertion), green with the fix.
  • bun run test:native from packages/core: 1709/1715 passed, 6 skipped, 0 failed.
  • End to end: the patched build driven under a pty harness that answers capability probes exactly like kitty 0.46.2 (xtversion, DECRQM, text-sizing probe cursor reports, kitty graphics query, DA1), so explicit_width is genuinely enabled through detection rather than forced. Captured output shows the control emoji wrapped in ]66;w=2; while all placeholder cells are emitted bare; before the patch every placeholder cell was wrapped.
  • Real-world origin: found in an app running in kitty 0.46.2 where images transmitted with a=T,U=1 and placed via placeholder cells rendered as blank space; with this change kitty draws them correctly.

zig fmt clean on both files.

@arthurkatcher
arthurkatcher force-pushed the fix/kitty-placeholder-explicit-width branch from 7da0877 to a43512b Compare July 29, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

explicit_width wraps kitty Unicode image placeholders (U+10EEEE) in OSC 66, kitty draws blank cells instead of images

1 participant